<template>
    <div>
        <van-nav-bar title="API使用" fixed placeholder left-arrow @click-left="onClickLeft" />
        <div class="col" v-for="item in productList" :key="item.id">
            <van-card num="2" price="2.00" desc="描述信息" :title="item.text"
                :thumb="item.url">
                <template #tags>
                    <van-tag plain type="primary">标签</van-tag>
                    <van-tag plain type="primary">标签</van-tag>
                </template>
                <template #footer>
                    <van-button size="mini">按钮</van-button>
                    <van-button size="mini">按钮</van-button>
                </template>
            </van-card>
        </div>
    </div>
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue';
import { NavBar, Card } from 'vant';
import { getProductList } from '@/api/test'
import { PTestReponesType } from '@/api/test/type'
const onClickLeft = () => history.back();
const productList = ref<PTestReponesType[]>() //嫌麻烦就写any
onMounted(async () => {
    let res = await getProductList({})
    productList.value = res?.data
    console.log(res)
});
</script>

<style scoped lang="scss">
.col {
   margin-bottom:12px;
}
</style>